<template>
  <div class="manager-container">
    <!-- 头部 -->
    <div class="manager-header">
      <div class="manager-header-left"></div>
      <div class="manager-header-center">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/teacher/home' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>{{ currentTitle }}</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
    </div>

    <el-container>
      <!-- 左侧菜单栏 -->
      <el-aside width="200px" class="aside-menu">
        <el-menu default-active="1" router>
          <el-menu-item index="/manage/weak-course">弱项课程管理</el-menu-item>
          <el-menu-item index="/manage/tutoring-plan">辅导计划管理</el-menu-item>
          <el-menu-item index="/manage/resources">资源管理</el-menu-item>
        </el-menu>
      </el-aside>

      <!-- 主内容区域 -->
      <el-main>
        <div class="main-content">
          <!-- 欢迎卡片 -->
          <el-card shadow="hover" class="welcome-card">
            <h2>欢迎使用学习管理</h2>
            <p>请选择左侧菜单中的功能项，查看相关管理内容。</p>
<!--            <el-button type="primary" @click="$router.push('/manage/weak-course')">立即前往</el-button>-->
          </el-card>

          <!-- 功能区块 -->
          <div class="features">
            <el-row gutter="20">
              <el-col :span="8">
                <el-card shadow="hover" class="feature-card">
                  <el-icon class="feature-icon"><i class="el-icon-document"></i></el-icon>
                  <h3>弱项课程管理</h3>
                  <p>快速查看并管理学生的弱项课程。</p>
                  <el-button type="text" @click="$router.push('/manage/weak-course')">查看详情</el-button>
                </el-card>
              </el-col>
              <el-col :span="8">
                <el-card shadow="hover" class="feature-card">
                  <el-icon class="feature-icon"><i class="el-icon-s-tools"></i></el-icon>
                  <h3>辅导计划管理</h3>
                  <p>制定并追踪学生的学习辅导计划。</p>
                  <el-button type="text" @click="$router.push('/manage/tutoring-plan')">查看详情</el-button>
                </el-card>
              </el-col>
              <el-col :span="8">
                <el-card shadow="hover" class="feature-card">
                  <el-icon class="feature-icon"><i class="el-icon-folder"></i></el-icon>
                  <h3>资源管理</h3>
                  <p>管理教学资源，支持学生课后学习。</p>
                  <el-button type="text" @click="$router.push('/manage/resources')">查看详情</el-button>
                </el-card>
              </el-col>
            </el-row>
          </div>
        </div>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "StudlyManagement",
  computed: {
    currentTitle() {
      return this.$route.meta.name || "内容展示";
    },
  },
};
</script>

<style scoped>
.manager-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f9fafc;
}

.manager-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: #ffffff;
  border-bottom: 1px solid #ebeef5;
}

.aside-menu {
  background-color: #f4f6f9;
}

.main-content {
  padding: 30px;
}

.welcome-card {
  text-align: center;
  margin-bottom: 30px;
  background-color: #ffffff; /* 与其他卡片保持一致 */
  border-radius: 10px;
}

.welcome-card h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.welcome-card p {
  font-size: 16px;
  margin-bottom: 20px;
}

.features {
  margin-top: 20px;
}

.feature-card {
  text-align: center;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-card h3 {
  font-size: 20px;
  margin: 10px 0;
  font-weight: bold;
}

.feature-card p {
  font-size: 14px;
  color: #606266;
  margin-bottom: 15px;
}

.feature-icon {
  font-size: 40px;
  color: #409eff;
  margin-bottom: 10px;
}

.el-button {
  margin-top: 10px;
}

.el-button.text {
  color: #409eff;
}

</style>
